package com.myspring.web.route.decorator;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * @author : zenghua
 * @version : v0.1 DecoratorRouteAspect.java
 * @since : 2017/8/24 10:44
 */
@Aspect
@Component
public class DecoratorRouteAspect implements ApplicationContextAware {

	private ApplicationContext context;

	@Pointcut("execution(public * com.myspring.web.route..*.load*(..))")
	public void routeService() {}

	@Before("routeService()")
	public void doBefore(JoinPoint joinPoint) {
        Class<?> clazz = joinPoint.getSignature().getDeclaringType();

		//获取LoanRequest中的channelCode，确定是哪个processsor，注入到当前DefaultChannelService

	}


	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.context = applicationContext;
	}

}
